#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
void  Print(int x)
{
	if (x > 9)
	{
		Print(x/ 10);
	}
	printf("%d\n",x% 10);
}
int main()
{
	int n = 0;
	scanf("%d", &n);
	Print(n);
	return 0;
}